package com.example.systemwork.controller;

import com.example.systemwork.common.controller.LogicController;
import com.example.systemwork.common.utils.Result;
import com.example.systemwork.dao.UserDao;
import com.example.systemwork.entity.User;
import com.example.systemwork.service.BusinessService;
import com.example.systemwork.service.UserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "用户的控制器")
@RestController
@RequestMapping("/user")
public class UserController extends LogicController<UserService, UserDao, User, Long> {

    public UserController ( @Autowired UserService ss ) {
        super ( ss );
    }
    @ApiOperation("登录")
    @GetMapping("/login")
    public Result login (@ApiParam("用户名")String username, @ApiParam("密码")String password) {
        return getService().login(username,password);
    }
}
